<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/header.jsp" %>
	    <title>Online Users - Virtual Judge</title>
<%--  		<script type="text/javascript" src="${contextPath}/javascript/listOL.js?<%=application.getAttribute("version")%>"></script> --%>
    </head>

	<body>
        <s:hidden id="js_require_listOL" />
		<s:include value="/top.jsp" />
		
		<div class="ptt">Online Users</div>
		
		<table>
			<tr>
				<td style="font-weight:bold;text-align:right;padding-right:5px">Session number: </td>
				<td><s:property value="%{dataList.size()}" /></td>
			</tr>
			<tr>
				<td style="font-weight:bold;text-align:right;padding-right:5px">User number: </td>
				<td><s:property value="loginUsers" /></td>
			</tr>
			<tr>
				<td style="font-weight:bold;text-align:right;padding-right:5px">IP map size: </td>
				<td><s:property value="ipMapCnt" /></td>
			</tr>
		</table>
		
		
		<table id="listOL" cellpadding="0" cellspacing="0" border="0" class="display" style="text-align:center" >
			<thead>
				<tr>
					<th>Session ID</th>
					<th>Username</th>
					<th class="ip">IP</th>
					<th>Address</th>
					<th>Arrive Time</th>
					<th>Active Length</th>
					<th>Freeze Length</th>
					<th class="browser">Browser</th>
                    <th class="os">OS</th>
                    <th></th>
				</tr>
			</thead>

			<s:iterator value="dataList" status="stat">
			<tr>
				<td>
					<a href="${contextPath}/stat/viewOL.action?id=<s:property value='dataList[#stat.index][0]' />">Detail</a>
				</td>
				<td>
					<a href="${contextPath}/user/profile.action?uid=<s:property value='dataList[#stat.index][2]' />">
						<s:property value='dataList[#stat.index][1]' />
					</a>
				</td>
                <td class="ip" title="<s:property value='dataList[#stat.index][3]' escapeHtml='false' />">
                    <s:property value="dataList[#stat.index][3]" escapeHtml="false" />
                </td>
				<td class="address">
					<s:property value="dataList[#stat.index][4]" />
				</td>
				<td><s:date name="dataList[#stat.index][5]" format="yyyy-MM-dd HH:mm:ss" /></td>
				<td><s:property value="dataList[#stat.index][6]" /></td>
				<td><s:property value="dataList[#stat.index][7]" /></td>
				<td><s:property value="dataList[#stat.index][8]" /></td>
                <td><s:property value="dataList[#stat.index][9]" /></td>
                <td>
                    <s:if test="dataList[#stat.index][10] != null">
                        <a href='<s:property value="dataList[#stat.index][10]" />' title='<s:property value="dataList[#stat.index][10]" />'>*</a>
                    </s:if>
                </td>
			</tr>
		</s:iterator>
		</table>

		<s:include value="/bottom.jsp" />
	</body>
</html>
